<%@ Page Language="C#" AutoEventWireup="true" Theme="YUI" CodeFile="Venues.aspx.cs"
    Inherits="Home_Venues" Trace="false" %>

<%@ Register Src="../UserControls/Menu.ascx" TagName="Menu" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>PlacementManager: Venues</title>
    <link href="../App_Themes/YUI/tabber.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">

/* Optional: Temporarily hide the "tabber" class so it does not "flash"
   on the page as plain HTML. After tabber runs, the class is changed
   to "tabberlive" and it will appear. */

document.write('<style type="text/css">.tabber{display:none;}<\/style>');

/*==================================================
  Set the tabber options (must do this before including tabber.js)
  ==================================================*/
var tabberOptions = {

  'cookie':"tabberVenues", /* Name to use for the cookie */

  'onLoad': function(argsObj)
  {
    var t = argsObj.tabber;
    var i;

    /* Optional: Add the id of the tabber to the cookie name to allow
       for multiple tabber interfaces on the site.  If you have
       multiple tabber interfaces (even on different pages) I suggest
       setting a unique id on each one, to avoid having the cookie set
       the wrong tab.
    */
    if (t.id) {
      t.cookie = t.id + t.cookie;
    }

    /* If a cookie was previously set, restore the active tab */
    i = parseInt(getCookie(t.cookie));
    if (isNaN(i)) { return; }
    t.tabShow(i);
    //alert('getCookie(' + t.cookie + ') = ' + i);
  },

  'onClick':function(argsObj)
  {
    var c = argsObj.tabber.cookie;
    var i = argsObj.index;
    //alert('setCookie(' + c + ',' + i + ')');
    setCookie(c, i);
  }
};

/*==================================================
  Cookie functions
  ==================================================*/
function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain) {
    if (getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

    </script>

    <script language="javascript" type="text/javascript" src="../scripts/tabber-minimized.js"></script>

    <script language="javascript" type="text/javascript">
    function showToolTip(e,text){ 
      var ToolTip = document.getElementById("ToolTip");
      ToolTip.innerHTML=text; 
      ToolTip.style.left=(e.clientX+15+document.body.scrollLeft)+'px'; 
      ToolTip.style.top=(e.clientY+document.body.scrollTop)+'px';  
      ToolTip.style.display="block";
    } 
    function hideToolTip(){ 
        var ToolTip = document.getElementById("ToolTip");
        ToolTip.style.display="none"; 
    } 
    function showAddVenue()
    {
        var divAddVenue = document.getElementById("divAddVenue");
        divAddVenue.style.display = "block";
    }
    function hideAddVenue()
    {
        var divAddVenue = document.getElementById("divAddVenue");
        divAddVenue.style.display = "none";
    }
    function showAddContact()
    {
        var divAddContact = document.getElementById("divAddContact");
        divAddContact.style.display = "block";
    }
    function hideAddContact()
    {
        var divAddContact = document.getElementById("divAddContact");
        divAddContact.style.display = "none";
    }
    function showAddNote()
    {
        var divAddContact = document.getElementById("divAddNote");
        divAddContact.style.display = "block";
    }
    function hideAddNote()
    {
        var divAddContact = document.getElementById("divAddNote");
        divAddContact.style.display = "none";
    }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="True">
        </ajaxToolkit:ToolkitScriptManager>
        <div id="ToolTip" style="position: absolute; z-index: 1000; text-align: left;display:none;">
        </div>
        <div id="doc3" class="yui-t3">
            <div id="hd">
                <uc1:Menu ID="Menu1" runat="server" />
            </div>
            <div id="bd">
                <div class="yui-b">
                    <asp:UpdatePanel ID="updtpnlVenuesGrid" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnSaveVenue" EventName="Click" />
                        </Triggers>
                        <ContentTemplate>
                            <div style="background-color:#AD8282;width:155px;padding-left:3px; padding-right: 3px; padding-bottom: 3px; padding-top: 3px;">
                            <asp:TextBox ID="txtSearchName" runat="server" Width="120px"></asp:TextBox>
                            <asp:ImageButton ID="imgbtnSearch" runat="server" ImageUrl="~/Images/Icons/search.gif"
                                OnClick="imgbtnSearch_Click" CssClass="SearchImageButton" ImageAlign="AbsMiddle" />
                            <ajaxToolkit:AutoCompleteExtender ID="aceSearchName" runat="server" ServiceMethod="GetVenues"
                                ServicePath="../WebServices/VenueService.asmx" TargetControlID="txtSearchName">
                            </ajaxToolkit:AutoCompleteExtender>
                            </div>
                            <br />
                            <asp:GridView ID="gvVenues" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                DataKeyNames="VenueId" DataSourceID="odsVenues_GV" SelectedIndex="0" SkinID="Results"
                                PageSize="18" OnSelectedIndexChanged="gvVenues_SelectedIndexChanged" GridLines="None"
                                CellPadding="0" OnDataBound="gvVenues_DataBound" ShowHeader="False" OnRowCreated="gvVenues_RowCreated"
                                OnRowDataBound="gvVenues_RowDataBound" OnPageIndexChanged="gvVenues_PageIndexChanged">
                                <Columns>
                                    <asp:CommandField ShowSelectButton="True" ButtonType="Image" SelectImageUrl="~/Images/Icons/edit.gif" />
                                    <asp:TemplateField ShowHeader="False" SortExpression="VenueName">
                                        <ItemTemplate>
                                            <asp:Label ID="lblVenueName" runat="server" Text='<%# GetTruncatedVenueName(Eval("VenueName").ToString()) %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <EmptyDataTemplate>
                                    No venues found
                                </EmptyDataTemplate>
                                <PagerSettings Mode="NumericFirstLast" />
                            </asp:GridView>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                <div id="yui-main">
                    <div class="yui-b">
                        <span style="font-size: large; font-weight: bold; float: left;">Manage Venues</span>
                        <asp:UpdateProgress ID="updtprogVenuesGrid" runat="server" AssociatedUpdatePanelID="updtpnlVenuesGrid"
                            DisplayAfter="2" DynamicLayout="false">
                            <ProgressTemplate>
                                &nbsp; &nbsp;&nbsp;
                                <img alt="Progress" src="../Images/progressbar_long_green.gif" />
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                        <div class="tabber" id="mainTabset">
                            <div class="tabbertab">
                                <h2>
                                    Venue Details</h2>
                                <div class="yui-g">
                                    <div class="yui-u first">
                                        <asp:UpdatePanel ID="updtpnlVenueDetails" runat="server" UpdateMode="Conditional">
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="SelectedIndexChanged" />
                                                <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="DataBound" />
                                            </Triggers>
                                            <ContentTemplate>
                                                <asp:FormView ID="fvVenueDetails" runat="server" DataSourceID="odsVenue_FV" OnItemUpdated="fvVenueDetails_ItemUpdated"
                                                    OnItemUpdating="fvVenueDetails_ItemUpdating" Width="100%">
                                                    <EditItemTemplate>
                                                        <table>
                                                            <tr>
                                                                <td class="formLabel" style="width: 100px">
                                                                    Venue Name:</td>
                                                                <td>
                                                                    <asp:TextBox ID="VenueNameTextBox" runat="server" Text='<%# Bind("VenueName") %>'
                                                                        MaxLength="255"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                <td class="formLabel" style="width: 100px">
                                                                    Telephone:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="TelephoneNumberTextBox" runat="server" Text='<%# Bind("TelephoneNumber") %>'
                                                                        MaxLength="20"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="formLabel" style="width: 100px">
                                                                    Fax:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="FaxTextBox" runat="server" Text='<%# Bind("Fax") %>' MaxLength="20"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="formLabel" style="width: 100px">
                                                                    Generic Email:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="GenericEmailTextBox" runat="server" Text='<%# Bind("GenericEmail") %>'
                                                                        MaxLength="255"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                        <asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                                                            Text="Update" CssClass="inputbutton"></asp:Button>
                                                        <asp:Button ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                                            Text="Cancel" CssClass="inputbutton"></asp:Button>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <span style="font-size: larger;">
                                                            <asp:Label ID="VenueNameLabel" runat="server" Text='<%# Bind("VenueName") %>'></asp:Label></span><br />
                                                        <span class="formLabel">Tel:</span><asp:Label ID="TelephoneNumberLabel" runat="server"
                                                            Text='<%# GetTelephoneFaxEmailNumber(Eval("TelephoneNumber").ToString()) %>'></asp:Label>
                                                        <br />
                                                        <span class="formLabel">Fax:</span><asp:Label ID="FaxLabel" runat="server" Text='<%# GetTelephoneFaxEmailNumber(Eval("Fax").ToString()) %>'></asp:Label>
                                                        <br />
                                                        <span class="formLabel">Email:</span><asp:Label ID="EmailAddressLabel" runat="server"
                                                            Text='<%# Eval("GenericEmail","<a href=mailto:{0}>{0}</a>") %>'></asp:Label>
                                                        <br />
                                                        <span class="formLabel">Parent Venue:</span><asp:Label ID="lblParentVenue" runat="server"
                                                            Text='<%# GetParentVenue(Eval("ParentVenueId").ToString()) %>'></asp:Label>
                                                        <br />
                                                        <asp:Button ID="btnEditVenue" runat="server" CommandName="Edit" CssClass="inputbutton"
                                                            Text="Edit" />
                                                        <asp:Button ID="btnDeleteVenue" runat="server" CssClass="inputbutton" OnClick="btnDeleteVenue_Click"
                                                            Text="Delete" />
                                                        <ajaxToolkit:ConfirmButtonExtender ID="cbeDeleteVenue" runat="server" ConfirmText="Are you sure that you want to delete this venue?"
                                                            TargetControlID="btnDeleteVenue">
                                                        </ajaxToolkit:ConfirmButtonExtender>
                                                    </ItemTemplate>
                                                </asp:FormView>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                        <input id="btnShowAddNewVenue" type="button" value="Add New Venue" onclick="showAddVenue();"
                                            class="inputbutton" />&nbsp;</div>
                                    <div class="yui-u">
                                        <asp:UpdatePanel ID="updtpnlVenueAddress" runat="server" UpdateMode="Conditional">
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="SelectedIndexChanged" />
                                                <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="DataBound" />
                                            </Triggers>
                                            <ContentTemplate>
                                                <asp:FormView ID="fvAddress" runat="server" DataSourceID="odsAddresses_DL" OnItemDeleted="fvAddress_ItemDeleted"
                                                    DataKeyNames="AddressId" OnItemUpdated="fvAddress_ItemUpdated" OnItemUpdating="fvAddress_ItemUpdating">
                                                    <EditItemTemplate>
                                                        <table width="100%">
                                                            <tr>
                                                                <td class="formLabel">
                                                                    Address1:</td>
                                                                <td>
                                                                    <asp:TextBox ID="Address1TextBox" runat="server" Text='<%# Bind("Address1") %>'></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                <td class="formLabel">
                                                                    Address2:</td>
                                                                <td>
                                                                    <asp:TextBox ID="Address2TextBox" runat="server" Text='<%# Bind("Address2") %>'></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                <td class="formLabel">
                                                                    Street:</td>
                                                                <td>
                                                                    <asp:TextBox ID="StreetTextBox" runat="server" Text='<%# Bind("Street") %>'></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                <td class="formLabel">
                                                                    Country:</td>
                                                                <td>
                                                                    <asp:DropDownList ID="ddEditCountry" runat="server" AutoPostBack="True" CssClass="dropdownlist"
                                                                        DataSourceID="odsCountries" DataTextField="CountryName" DataValueField="CountryID"
                                                                        OnSelectedIndexChanged="ddNewContactCountry_SelectedIndexChanged" SelectedValue='<%# Bind("CountryId") %>'>
                                                                    </asp:DropDownList></td>
                                                            </tr>
                                                            <tr>
                                                                <td class="formLabel">
                                                                    State:</td>
                                                                <td>
                                                                    <asp:DropDownList ID="ddEditState" runat="server" AutoPostBack="True" CssClass="dropdownlist"
                                                                        DataSourceID="odsStates" DataTextField="DivisionName" DataValueField="AdministrativeDivisionID"
                                                                        SelectedValue='<%# Bind("StateId") %>'>
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="formLabel">
                                                                    Town/City:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtEditCity" runat="server" CssClass="inserttext" Text='<%# Bind("City") %>'></asp:TextBox>
                                                                    <ajaxToolkit:AutoCompleteExtender ID="aceEditCity" runat="server" BehaviorID="AutoCompleteBehavior"
                                                                        ContextKey="2" ServiceMethod="GetLocationsForState" ServicePath="~/WebServices/Geo_LocationService.asmx"
                                                                        TargetControlID="txtEditCity" UseContextKey="True" EnableCaching="False" DelimiterCharacters=""
                                                                        Enabled="True">
                                                                    </ajaxToolkit:AutoCompleteExtender>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="formLabel">
                                                                    PostCode:</td>
                                                                <td>
                                                                    <asp:TextBox ID="txtEditPostCode" runat="server" CssClass="inserttext" Text='<%# Bind("PostCode") %>'></asp:TextBox>
                                                                    <asp:ImageButton ID="imgbtnEditFindPostCode" runat="server" ImageUrl="~/Images/Icons/search.gif"
                                                                        OnClick="imgbtnEditFindPostCode_Click" ToolTip="Find Post Code" /></td>
                                                            </tr>
                                                        </table>
                                                        <asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                                                            Text="Update" CssClass="inputbutton"></asp:Button>
                                                        <asp:Button ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                                            Text="Cancel" CssClass="inputbutton"></asp:Button>
                                                    </EditItemTemplate>
                                                    <EmptyDataTemplate>
                                                        No address has been added for this venue.
                                                    </EmptyDataTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="AddressLabel" runat="server" Text='<%# GetFormattedAddress(Eval("AddressId").ToString()) %>'></asp:Label><br />
                                                        <asp:Button ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                                                            Text="Edit" CssClass="inputbutton"></asp:Button>
                                                    </ItemTemplate>
                                                </asp:FormView>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </div>
                                </div>
                                <div style="display: none;" id="divAddVenue">
                                    <asp:UpdatePanel ID="updtpnlAddVenue" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
                                        <ContentTemplate>
                                            <fieldset id="fldAddVenue">
                                                <legend id="lgdAddVenue">Add New Venue</legend>
                                                <table width="100%">
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            Name:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewVenueName" runat="server" MaxLength="255" ToolTip="Enter the name of the new venue."></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="rfvNewVenueName" runat="server" ControlToValidate="txtNewVenueName"
                                                                CssClass="message" ErrorMessage="Please enter a venue name" ForeColor="" ValidationGroup="valgrpAddNewVenue">*</asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            Telephone:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewVenueTelephone" runat="server" MaxLength="255" ToolTip="Enter the name of the new venue."></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="rfvNewVenueTelephone" runat="server" ControlToValidate="txtNewVenueTelephone"
                                                                CssClass="message" ErrorMessage="Please enter a telephone number" ForeColor=""
                                                                ValidationGroup="valgrpAddNewVenue">*</asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            Fax:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewVenueFax" runat="server" MaxLength="255" ToolTip="Enter the name of the new venue."></asp:TextBox></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            Generic Email:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewVenueGenericEmail" runat="server" MaxLength="255" ToolTip="Enter the name of the new venue."></asp:TextBox></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            Address1:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewAddress1" runat="server"></asp:TextBox></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            Address2:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewAddress2" runat="server"></asp:TextBox></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            Street:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewStreet" runat="server"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="rfvNewVenueStreet" runat="server" ControlToValidate="txtNewStreet"
                                                                CssClass="message" ErrorMessage="Please enter  a street address" ForeColor=""
                                                                ValidationGroup="valgrpAddNewVenue">*</asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            Country:</td>
                                                        <td>
                                                            <asp:DropDownList ID="ddNewCountry" runat="server" AutoPostBack="True" DataSourceID="odsCountries"
                                                                DataTextField="CountryName" DataValueField="CountryID" OnSelectedIndexChanged="ddNewContactCountry_SelectedIndexChanged">
                                                            </asp:DropDownList></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            State:</td>
                                                        <td>
                                                            <asp:DropDownList ID="ddNewState" runat="server" AutoPostBack="True" DataSourceID="odsStates"
                                                                DataTextField="DivisionName" DataValueField="AdministrativeDivisionID">
                                                            </asp:DropDownList>&nbsp;
                                                            <asp:ObjectDataSource ID="odsStates" runat="server" OldValuesParameterFormatString="original_{0}"
                                                                SelectMethod="SelectAllWCountryID" TypeName="PlacementManager.Geo_AdministrativeDivisionComponent">
                                                                <SelectParameters>
                                                                    <asp:ControlParameter ControlID="ddNewCountry" Name="CountryID" PropertyName="SelectedValue"
                                                                        Type="Int32" />
                                                                    <asp:Parameter DefaultValue="DivisionName" Name="sortExpression" Type="String" />
                                                                </SelectParameters>
                                                            </asp:ObjectDataSource>
                                                            <asp:ObjectDataSource ID="odsPossibleLocations" runat="server" OldValuesParameterFormatString="original_{0}"
                                                                SelectMethod="SelectAllWAdministrativeDivisionIDStartingWith" TypeName="PlacementManager.Geo_LocationComponent">
                                                                <SelectParameters>
                                                                    <asp:ControlParameter ControlID="txtNewCity" Name="prefix" PropertyName="Text" Type="String" />
                                                                    <asp:ControlParameter ControlID="ddNewState" Name="AdministrativeDivisionID" PropertyName="SelectedValue"
                                                                        Type="Int32" />
                                                                    <asp:Parameter DefaultValue="FullName" Name="sortExpression" Type="String" />
                                                                </SelectParameters>
                                                            </asp:ObjectDataSource>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            Town/City:
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewCity" runat="server"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="rfvNewVenueCity" runat="server" ControlToValidate="txtNewCity"
                                                                CssClass="message" ErrorMessage="Please enter a town or city" ForeColor="" ValidationGroup="valgrpAddNewVenue">*</asp:RequiredFieldValidator>
                                                            <ajaxToolkit:AutoCompleteExtender ID="aceNewCity" runat="server" BehaviorID="acbNewCity"
                                                                ContextKey="2" DelimiterCharacters="" EnableCaching="False" Enabled="True" ServiceMethod="GetLocationsForState"
                                                                ServicePath="~/WebServices/Geo_LocationService.asmx" TargetControlID="txtNewCity"
                                                                UseContextKey="True">
                                                            </ajaxToolkit:AutoCompleteExtender>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px">
                                                            PostCode:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewPostCode" runat="server"></asp:TextBox>
                                                            <asp:ImageButton ID="imgbtnFindPostCode" runat="server" ImageUrl="~/Images/Icons/search.gif"
                                                                OnClick="imgbtnFindPostCode_Click" ToolTip="Find Post Code" />
                                                            <asp:RequiredFieldValidator ID="rfvNewVenuePostCode" runat="server" ControlToValidate="txtNewPostCode"
                                                                CssClass="message" ErrorMessage="Please enter a postcode" ForeColor="" ValidationGroup="valgrpAddNewVenue">*</asp:RequiredFieldValidator></td>
                                                    </tr>
                                                </table>
                                                <asp:Button ID="btnSaveVenue" runat="server" OnClick="btnSaveVenue_Click" Text="Save New Venue"
                                                    CssClass="inputbutton" ValidationGroup="valgrpAddNewVenue" />
                                                <input id="btnHideAddVenue" type="button" value="Cancel" onclick="hideAddVenue();"
                                                    class="inputbutton" />
                                                <asp:ValidationSummary ID="valSummaryAddVenue" runat="server" CssClass="message"
                                                    EnableTheming="False" ForeColor="" ValidationGroup="valgrpAddNewVenue" />
                                                <asp:Label ID="lblAddNewVenueMessage" runat="server" CssClass="message"></asp:Label>
                                            </fieldset>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </div>
                            </div>
                            <div class="tabbertab">
                                <h2>
                                    Contacts</h2>
                                <asp:UpdatePanel ID="updtpnlContacts" runat="server" UpdateMode="Conditional">
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="SelectedIndexChanged" />
                                        <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="DataBound" />
                                        <asp:AsyncPostBackTrigger ControlID="btnAddNewContact" EventName="Click" />
                                    </Triggers>
                                    <ContentTemplate>
                                        <asp:DataList ID="dlContacts" DataKeyField="ContactId" RepeatColumns="3" RepeatDirection="Horizontal"
                                            runat="server" DataSourceID="odsContacts_GV" OnDeleteCommand="dlContacts_DeleteCommand"
                                            OnItemCommand="dlContacts_ItemCommand" OnItemDataBound="dlContacts_ItemDataBound">
                                            <ItemTemplate>
                                                <div style="float:right;">
                                                <asp:ImageButton ID="imgbtnDeleteContact" runat="server" CommandName="Delete" ImageUrl="~/Images/Icons/x.gif"
                                                    ToolTip="Delete" />
                                                
                                           </div>
                                                <asp:HyperLink ID="hypFirstNameLink" runat="server" NavigateUrl='<%# Eval("ContactId","Contacts.aspx?id={0}") %>' Text='<%# Eval("FirstName")  %>'></asp:HyperLink>
                                                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ContactId","Contacts.aspx?id={0}") %>' Text='<%# Eval("LastName")  %>'></asp:HyperLink>
                                                <br />
                                                <asp:Label ID="lblJobTitle" runat="server" Text='<%# Bind("JobTitle") %>'></asp:Label>
                                                <br />
                                                <asp:Label ID="lblEmail" runat="server" Text='<%# Eval("EmailAddress","<a href=mailto:{0}>{0}</a>") %>'></asp:Label>
                                                <br />
                                                <asp:Label ID="lblContactId" runat="server" Text='<%# Eval("ContactId") %>' Visible="false"></asp:Label>
                                                <asp:Label ID="lblPrimaryAddress" runat="server" Text='<%# GetPrimaryAddressForContact(Eval("ContactId").ToString()) %>'></asp:Label>&nbsp;
                                                <asp:DataList ID="dlContactNumbers" runat="server" DataSourceID="odsContactNumbers">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblContactNumberType" runat="server" Text='<%# GetContactNumberType(Eval("ContactNumberId").ToString()) %>'></asp:Label>
                                                        <asp:Label ID="lblContactNumber" runat="server" Text='<%# GetContactNumber(Eval("ContactNumberId").ToString()) %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:DataList>
                                                <asp:ObjectDataSource ID="odsContactNumbers" runat="server" OldValuesParameterFormatString="original_{0}"
                                                    SelectMethod="SelectAllWContactId" TypeName="PlacementManager.LinkContactContactNumberComponent">
                                                    <SelectParameters>
                                                        <asp:ControlParameter ControlID="lblContactId" DefaultValue="1" Name="ContactId"
                                                            PropertyName="Text" Type="Int32" />
                                                        <asp:Parameter DefaultValue="DateCreated" Name="sortExpression" Type="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <ajaxToolkit:ConfirmButtonExtender ID="cbeDeleteContact" runat="server" ConfirmText="Are you sure that you want to remove the association between this venue and this contact? Doing so will not delete the contact record itself."
                                                    TargetControlID="imgbtnDeleteContact">
                                                </ajaxToolkit:ConfirmButtonExtender>
                                                <br />
                                                <asp:Button ID="btnMakeContactPrimary" runat="server" CommandName="MakeContactPrimary"
                                                    CssClass="inputbutton" Text="Make Primary" Visible='<%# ShowMakePrimaryContactButton(Eval("ContactId").ToString()) %>' />
                                            </ItemTemplate>
                                            <ItemStyle CssClass="AddressRepeaterItem" VerticalAlign="Top" />
                                        </asp:DataList>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                                <input id="btnShowAddNewContact" type="button" value="Add New Contact" class="inputbutton"
                                    onclick="showAddContact();" runat="server" />
                                <div style="display: none;" id="divAddContact">
                                    <asp:UpdatePanel ID="updtpnlAddNewContact" runat="server" ChildrenAsTriggers="true"
                                        UpdateMode="Conditional">
                                        <ContentTemplate>
                                            <fieldset id="fldNewContact">
                                                <legend id="lgdNewContact">Add New Contact</legend>
                                                <table width="100%">
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px" valign="top">
                                                            Title:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewContactTitle" runat="server" MaxLength="255" ToolTip="Enter the first name of the new contact."></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="rfvNewContactTitle" runat="server" ControlToValidate="txtNewContactTitle"
                                                                CssClass="message" ErrorMessage="Please enter the contact's title e.g. Mr, Ms, Professor etc."
                                                                ForeColor="" ValidationGroup="valgrpNewContact">*</asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px" valign="top">
                                                            First Name:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewContactFirstName" runat="server" MaxLength="255" ToolTip="Enter the first name of the new contact."></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="rfvNewContactFirstName" runat="server" ControlToValidate="txtNewContactFirstName"
                                                                CssClass="message" ErrorMessage="Please enter the contact's first name" ForeColor=""
                                                                ValidationGroup="valgrpNewContact">*</asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px" valign="top">
                                                            Last Name:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewContactLastName" runat="server" MaxLength="255" ToolTip="Enter the first name of the new contact."></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="rfvNewContactLastName" runat="server" ControlToValidate="txtNewContactLastName"
                                                                CssClass="message" ErrorMessage="Please enter the contact's last Name" ForeColor=""
                                                                ValidationGroup="valgrpNewContact">*</asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px" valign="top">
                                                            Job Title:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewContactJobTitle" runat="server" MaxLength="255" ToolTip="Enter the first name of the new contact."></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="rfvNewContactJobTitle" runat="server" ControlToValidate="txtNewContactJobTitle"
                                                                CssClass="message" ErrorMessage="Please enter the contact's job title" ForeColor=""
                                                                ValidationGroup="valgrpNewContact">*</asp:RequiredFieldValidator></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px" valign="top">
                                                            Email:</td>
                                                        <td>
                                                            <asp:TextBox ID="txtNewContactEmail" runat="server" MaxLength="255" ToolTip="Enter the first name of the new contact."></asp:TextBox><br />
                                                            <asp:RegularExpressionValidator ID="revNewContactEmail" runat="server" ControlToValidate="txtNewContactEmail"
                                                                CssClass="message" ErrorMessage="Please enter a valid email address" ForeColor=""
                                                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="valgrpNewContact">*</asp:RegularExpressionValidator></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px" valign="top">
                                                        </td>
                                                        <td>
                                                            <asp:CheckBox ID="cbNewContactIsPrimary" runat="server" Text="Is Primary Contact" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="formLabel" style="width: 131px" valign="top">
                                                        </td>
                                                        <td>
                                                            <asp:Button ID="btnAddNewContact" runat="server" CssClass="inputbutton" OnClick="btnAddNewContact_Click"
                                                                Text="Save New Contact" ValidationGroup="valgrpNewContact" />
                                                            <input id="btnHideAddNewContact" type="button" value="Cancel" class="inputbutton"
                                                                onclick="hideAddContact();" />
                                                            <asp:ValidationSummary ID="valSummaryNewContact" runat="server" CssClass="message"
                                                                ForeColor="" ValidationGroup="valgrpNewContact" />
                                                            <br />
                                                            <asp:Label ID="lblAddNewContactMessage" runat="server" CssClass="message"></asp:Label></td>
                                                    </tr>
                                                </table>
                                            </fieldset>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </div>
                            </div>
                            <div class="tabbertab">
                                <h2>
                                    Notes</h2>
                                <asp:UpdatePanel ID="updtpnlNotes" runat="server" UpdateMode="Conditional">
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="SelectedIndexChanged" />
                                        <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="DataBound" />
                                        <asp:AsyncPostBackTrigger ControlID="btnSaveNote" EventName="Click" />
                                    </Triggers>
                                    <ContentTemplate>
                                        <asp:GridView ID="gvNotes" runat="server" AutoGenerateColumns="False" DataSourceID="odsComments"
                                            EmptyDataText="No notes have been added for this venue." ShowHeader="False" SkinID="Notes"
                                            Width="90%" DataKeyNames="NoteId" OnRowUpdating="gvNotes_RowUpdating" OnRowCommand="gvNotes_RowCommand">
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <hr style="height: 1px" />
                                                        <p>
                                                        Created On:
                                                        <asp:Label ID="lblCommentDateCreated" runat="server" Text='<%# Bind("DateCreated") %>'></asp:Label>
                                                        By:
                                                        <asp:Label ID="lblCommentCreatedBy" runat="server" Text='<%# Bind("CreatedBy") %>'></asp:Label>
                                                        <br />
                                                        Last Updated On: <asp:Label ID="lblCommentDateUpdated" runat="server" Text='<%# Bind("DateUpdated") %>'></asp:Label>
                                                        By:
                                                        <asp:Label ID="lblCommentUpdatedBy" runat="server" Text='<%# Bind("UpdatedBy") %>'></asp:Label>
                                                            </p>
                                                            <br />
                                                            Comment:
                                                            <asp:Label ID="lblComment" runat="server" Text='<%# Bind("NoteText") %>'></asp:Label>
                                                            <br />
                                                            <asp:LinkButton ID="lbEdit" CommandName="Edit" runat="server">Edit</asp:LinkButton>
                                                            <asp:LinkButton ID="lbDelete" runat="server" CommandArgument='<%# Bind("NoteId") %>' CommandName="DeleteNote">Delete</asp:LinkButton>
                                                        <ajaxToolkit:ConfirmButtonExtender ID="cbeDeleteNote" runat="server" ConfirmText="Are you sure that you want to delete this note?"
                                                            TargetControlID="lbDelete">
                                                        </ajaxToolkit:ConfirmButtonExtender>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txtEditNote" runat="server" Height="80px" MaxLength="8000" TextMode="MultiLine"
                                                            Width="90%" Text='<%# Bind("NoteText") %>'></asp:TextBox><br />
                                                        <asp:LinkButton ID="lbUpdate" CommandName="Update" runat="server">Update</asp:LinkButton>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                                <br />
                                <input id="btnShowAddNewNote" type="button" value="Add New Note" class="inputbutton"
                                    onclick="showAddNote();" />
                                <div style="display: none;" id="divAddNote">
                                    <fieldset id="fldAddNote">
                                        <legend id="lgdAddNote">Add Note</legend>
                                        <asp:UpdatePanel ID="updtpnlNewNote" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <asp:TextBox ID="txtAddNewNote" runat="server" Height="80px" MaxLength="8000" TextMode="MultiLine"
                                                    Width="90%"></asp:TextBox><br />
                                                <asp:Button ID="btnSaveNote" runat="server" CssClass="inputbutton" OnClick="btnSaveNote_Click"
                                                    Text="Save Note" />
                                                <input id="btnHideAddNote" type="button" value="Cancel" class="inputbutton" onclick="hideAddNote();" />
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </fieldset>
                                </div>
                            </div>
                            <div class="tabbertab">
                                <h2>
                                    Categories, Units, Child Venues</h2>
                                <div class="yui-g">
                                    <div class="yui-u first">
                                        <fieldset id="fldstCategories">
                                            <legend id="lgdCategories">Categories</legend>
                                            <asp:UpdatePanel ID="updtpnlCategories" runat="server" UpdateMode="Conditional">
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="SelectedIndexChanged" />
                                                    <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="DataBound" />
                                                </Triggers>
                                                <ContentTemplate>
                                                    <asp:GridView ID="gvCategories" runat="server" AutoGenerateColumns="False" DataSourceID="odsCategories_GV"
                                                        EmptyDataText="No categories have been linked to this venue" DataKeyNames="CategoryId"
                                                        SkinID="Results" OnRowCommand="gvCategories_RowCommand">
                                                        <Columns>
                                                            <asp:ButtonField CommandName="DeleteCategoryLink" Text="Remove association" ButtonType="Image"
                                                                ImageUrl="~/Images/Icons/x.gif" />
                                                            <asp:BoundField DataField="CategoryName" HeaderText="Category Name" SortExpression="CategoryName" />
                                                        </Columns>
                                                    </asp:GridView>
                                                    Available Categories:<br />
                                                    <asp:ListBox ID="lbAvailableCategories" runat="server" DataSourceID="odsAvailableCategories"
                                                        DataTextField="CategoryName" DataValueField="CategoryId" OnDataBound="lbAvailableCategories_DataBound"
                                                        SelectionMode="Multiple" Rows="3" CssClass="dropdownlist"></asp:ListBox><br />
                                                    <asp:Button ID="btnAddCategories" runat="server" CssClass="inputbutton" OnClick="btnAddCategories_Click"
                                                        Text="Add Categories" />
                                                    <asp:Label ID="lblNoCategoriesAvailable" runat="server" Text="No categories are available."
                                                        Visible="False"></asp:Label><br />
                                                </ContentTemplate>
                                            </asp:UpdatePanel>
                                        </fieldset>
                                        <fieldset id="fldstUnits">
                                            <legend id="lgdUnits">Units</legend>
                                            <asp:UpdatePanel ID="updtpnlUnits" runat="server" UpdateMode="Conditional">
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="SelectedIndexChanged" />
                                                    <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="DataBound" />
                                                </Triggers>
                                                <ContentTemplate>
                                                    <asp:GridView ID="gvLinkedUnits" runat="server" AutoGenerateColumns="False" DataSourceID="odsLinkedUnits"
                                                        SkinID="Results" DataKeyNames="VenueUnitId" OnRowCommand="gvLinkedUnits_RowCommand">
                                                        <Columns>
                                                            <asp:TemplateField ShowHeader="False">
                                                                <ItemTemplate>
                                                                    <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandArgument='<%# Bind("VenueUnitId") %>'
                                                                        CommandName="DeleteUnitLink" ImageUrl="~/Images/Icons/x.gif" Text="Remove unit association" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Unit">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="Label1" runat="server" Text='<%# GetUnitCode(Eval("UnitId").ToString()) %>'></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Campus">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="Label2" runat="server" Text='<%# GetCampusCode(Eval("CampusId").ToString()) %>'></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                                    <asp:DropDownList ID="ddNewLinkedUnit" runat="server" DataSourceID="odsUnits" DataTextField="UnitCode"
                                                        DataValueField="UnitId" CssClass="dropdownlist">
                                                    </asp:DropDownList>
                                                    <asp:DropDownList ID="ddNewLinkedCampus" runat="server" DataSourceID="odsCampuses"
                                                        DataTextField="CampusCode" DataValueField="CampusId" CssClass="dropdownlist">
                                                    </asp:DropDownList><br />
                                                    <asp:Button ID="btnAddUnit" runat="server" CssClass="inputbutton" Text="Add Unit"
                                                        OnClick="btnAddUnit_Click" />
                                                </ContentTemplate>
                                            </asp:UpdatePanel>
                                        </fieldset>
                                    </div>
                                    <div class="yui-u">
                                        <fieldset id="fldstChildVenues">
                                            <legend id="lgdChildVenues">Child Venues</legend>
                                            <asp:UpdatePanel ID="updtpnlChildVenues" runat="server" UpdateMode="Conditional">
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="SelectedIndexChanged" />
                                                    <asp:AsyncPostBackTrigger ControlID="gvVenues" EventName="DataBound" />
                                                </Triggers>
                                                <ContentTemplate>
                                                    <asp:GridView ID="gvChildVenues" runat="server" AutoGenerateColumns="False" DataSourceID="odsChildVenues_GV"
                                                        DataKeyNames="VenueId" OnRowCommand="gvChildVenues_RowCommand" SkinID="Results">
                                                        <Columns>
                                                            <asp:ButtonField ButtonType="Image" CommandName="RemoveChildVenue" ImageUrl="~/Images/Icons/x.gif"
                                                                Text="Remove child venue" />
                                                            <asp:BoundField DataField="VenueName" HeaderText="Name" ShowHeader="False" SortExpression="VenueName" />
                                                        </Columns>
                                                        <EmptyDataTemplate>
                                                            No child venues.
                                                        </EmptyDataTemplate>
                                                    </asp:GridView>
                                                    <asp:TextBox runat="server" ID="txtAddChildVenue" />
                                                    <ajaxToolkit:AutoCompleteExtender runat="server" ID="aceAddChildExtender" TargetControlID="txtAddChildVenue"
                                                        ServicePath="~/WebServices/VenueService.asmx" ServiceMethod="GetVenues" MinimumPrefixLength="2"
                                                        CompletionSetCount="12" DelimiterCharacters="" Enabled="True" />
                                                    <asp:Button ID="btnAddChildVenue" runat="server" Text="Add Child Venue" CssClass="inputbutton"
                                                        OnClick="btnAddChildVenue_Click" />
                                                </ContentTemplate>
                                            </asp:UpdatePanel>
                                        </fieldset>
                                    </div>
                                </div>
                            </div>
                            <div class="tabbertab">
                                 <h2>
                                    Current Placements</h2>
                            </div>
                            <div class="tabbertab">
                                 <h2>
                                    Past Placements</h2>
                            </div>
                            <div class="tabbertab">
                                 <h2>
                                    Future Placements</h2>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="ft">
                &nbsp;
            </div>
        </div>
        <!--
    ********************************************************************* 
    Object Data Sources 
    ********************************************************************* 
    -->
        <asp:ObjectDataSource ID="odsAddresses_DL" runat="server" SelectMethod="SelectPrimaryAddressForVenue"
            TypeName="PlacementManager.AddressComponent" DeleteMethod="Delete" InsertMethod="Insert"
            OldValuesParameterFormatString="original_{0}" UpdateMethod="Update" DataObjectTypeName="PlacementManager.Address">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvVenues" Name="venueId" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="AddressId" Type="Int32" />
                <asp:Parameter Name="Address1" Type="String" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Address2" Type="String" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="Street" Type="String" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="City" Type="String" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="PostCode" Type="String" ConvertEmptyStringToNull="false" />
                <asp:Parameter Name="StateId" Type="Int32" />
                <asp:Parameter Name="CountryId" Type="Int32" />
                <asp:Parameter Name="IsPostal" Type="Boolean" />
                <asp:Parameter Name="Latitude" Type="Double" />
                <asp:Parameter Name="Longitude" Type="Double" />
                <asp:Parameter Name="IsActive" Type="Boolean" />
                <asp:Parameter Name="DateCreated" Type="DateTime" />
                <asp:Parameter Name="CreatedBy" Type="String" />
                <asp:Parameter Name="DateUpdated" Type="DateTime" />
                <asp:Parameter Name="UpdatedBy" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Address1" Type="String" />
                <asp:Parameter Name="Address2" Type="String" />
                <asp:Parameter Name="Street" Type="String" />
                <asp:Parameter Name="City" Type="String" />
                <asp:Parameter Name="PostCode" Type="String" />
                <asp:Parameter Name="StateId" Type="Int32" />
                <asp:Parameter Name="CountryId" Type="Int32" />
                <asp:Parameter Name="IsPostal" Type="Boolean" />
                <asp:Parameter Name="Latitude" Type="Double" />
                <asp:Parameter Name="Longitude" Type="Double" />
                <asp:Parameter Name="IsActive" Type="Boolean" />
                <asp:Parameter Name="DateCreated" Type="DateTime" />
                <asp:Parameter Name="CreatedBy" Type="String" />
                <asp:Parameter Name="DateUpdated" Type="DateTime" />
                <asp:Parameter Name="UpdatedBy" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsCampuses" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="SelectAll" TypeName="PlacementManager.CampusComponent">
            <SelectParameters>
                <asp:Parameter DefaultValue="CampusCode" Name="sortExpression" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsUnits" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="SelectAllWDivisionId" TypeName="PlacementManager.UnitComponent">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="" Name="DivisionId" SessionField="DivisionId"
                    Type="Int32" />
                <asp:Parameter DefaultValue="UnitCode" Name="sortExpression" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsVenues_GV" runat="server" DataObjectTypeName="PlacementManager.Venue"
            SelectMethod="SelectAllActiveStartingWith" SortParameterName="sortExpression"
            TypeName="PlacementManager.VenueComponent" UpdateMethod="Update" DeleteMethod="Delete"
            InsertMethod="Insert" OldValuesParameterFormatString="original_{0}">
            <SelectParameters>
                <asp:ControlParameter ControlID="txtSearchName" Name="prefix" PropertyName="Text"
                    Type="String" />
                <asp:Parameter DefaultValue="VenueName" Name="sortExpression" Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="VenueId" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="VenueName" Type="String" />
                <asp:Parameter Name="ParentVenueId" Type="Int32" />
                <asp:Parameter Name="TelephoneNumber" Type="String" />
                <asp:Parameter Name="Fax" Type="String" />
                <asp:Parameter Name="GenericEmail" Type="String" />
                <asp:Parameter Name="IsActive" Type="Boolean" />
                <asp:Parameter Name="DateCreated" Type="DateTime" />
                <asp:Parameter Name="CreatedBy" Type="String" />
                <asp:Parameter Name="DateUpdated" Type="DateTime" />
                <asp:Parameter Name="UpdatedBy" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsSingleVenue" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="SelectOne" TypeName="PlacementManager.VenueComponent">
            <SelectParameters>
                <asp:QueryStringParameter Name="VenueId" QueryStringField="id" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsVenue_FV" runat="server" SelectMethod="SelectOne" TypeName="PlacementManager.VenueComponent"
            DataObjectTypeName="PlacementManager.Venue" UpdateMethod="Update" InsertMethod="Insert"
            OldValuesParameterFormatString="original_{0}" ConvertNullToDBNull="false">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvVenues" Name="VenueId" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
            <InsertParameters>
                <asp:Parameter Name="VenueName" Type="String" />
                <asp:Parameter Name="ParentVenueId" Type="Int32" />
                <asp:Parameter Name="TelephoneNumber" Type="String" />
                <asp:Parameter Name="Fax" Type="String" />
                <asp:Parameter Name="GenericEmail" Type="String" />
                <asp:Parameter Name="IsActive" Type="Boolean" />
                <asp:Parameter Name="DateCreated" Type="DateTime" />
                <asp:Parameter Name="CreatedBy" Type="String" />
                <asp:Parameter Name="DateUpdated" Type="DateTime" />
                <asp:Parameter Name="UpdatedBy" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsChildVenues_GV" runat="server" SelectMethod="SelectAllWParentVenueId"
            TypeName="PlacementManager.VenueComponent">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvVenues" Name="parentVenueId" PropertyName="SelectedValue"
                    Type="Int32" />
                <asp:Parameter DefaultValue="VenueName" Name="sortExpression" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsContacts_GV" runat="server" SelectMethod="SelectAllWVenueId"
            TypeName="PlacementManager.ContactComponent">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvVenues" DefaultValue="" Name="venueId" PropertyName="SelectedValue"
                    Type="Int32" />
                <asp:Parameter DefaultValue="LastName" Name="sortExpression" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsCategories_GV" runat="server" SelectMethod="SelectAllWVenueId"
            TypeName="PlacementManager.CategoryComponent" OldValuesParameterFormatString="original_{0}">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvVenues" Name="venueId" PropertyName="SelectedValue"
                    Type="Int32" />
                <asp:SessionParameter DefaultValue="1" Name="divisionId" SessionField="DivisionId"
                    Type="Int32" />
                <asp:Parameter DefaultValue="CategoryName" Name="sortExpression" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsPrimaryAddress" runat="server" SelectMethod="SelectPrimaryAddressForVenue"
            TypeName="PlacementManager.AddressComponent">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvVenues" Name="venueId" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsLinkedUnits" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="SelectAllWVenueId" TypeName="PlacementManager.LinkVenueUnitComponent">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvVenues" Name="venueId" PropertyName="SelectedValue"
                    Type="Int32" />
                <asp:Parameter DefaultValue="UnitId" Name="sortExpression" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsAvailableCategories" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="SelectAllWithoutVenueIdDivisionId" TypeName="PlacementManager.CategoryComponent">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvVenues" DefaultValue="1" Name="venueId" PropertyName="SelectedValue"
                    Type="Int32" />
                <asp:SessionParameter DefaultValue="1" Name="divisionId" SessionField="DivisionId"
                    Type="Int32" />
                <asp:Parameter DefaultValue="CategoryName" Name="sortExpression" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsVenueRequirements" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="SelectAllWVenueIdDivisionId" TypeName="PlacementManager.VenueRequirementComponent">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvVenues" DefaultValue="1" Name="VenueId" PropertyName="SelectedValue"
                    Type="Int32" />
                <asp:SessionParameter Name="DivisionId" SessionField="DivisionId" Type="Int32" />
                <asp:Parameter DefaultValue="DateCreated" Name="sortExpression" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsVenueRequirement" runat="server"></asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsCountries" runat="server" DeleteMethod="Delete" InsertMethod="Insert"
            OldValuesParameterFormatString="original_{0}" SelectMethod="SelectAllWDisplay"
            TypeName="PlacementManager.Geo_CountryComponent" UpdateMethod="Update">
            <SelectParameters>
                <asp:Parameter DefaultValue="CountryName" Name="sortExpression" Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="CountryID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="CountryID" Type="Int32" />
                <asp:Parameter Name="CountryName" Type="String" />
                <asp:Parameter Name="CountryCode" Type="String" />
                <asp:Parameter Name="SubDivisionSingularName" Type="String" />
                <asp:Parameter Name="SubDivisionPluralName" Type="String" />
                <asp:Parameter Name="Display" Type="Boolean" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="CountryName" Type="String" />
                <asp:Parameter Name="CountryCode" Type="String" />
                <asp:Parameter Name="SubDivisionSingularName" Type="String" />
                <asp:Parameter Name="SubDivisionPluralName" Type="String" />
                <asp:Parameter Name="Display" Type="Boolean" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsComments" runat="server" DataObjectTypeName="PlacementManager.Note"
            DeleteMethod="DeleteAllWNoteTypeId" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}"
            SelectMethod="SelectAllWNoteTypeIdEntityId" TypeName="PlacementManager.NoteComponent"
            UpdateMethod="Update">
            <DeleteParameters>
                <asp:Parameter Name="NoteTypeId" Type="Int32" />
            </DeleteParameters>
            <SelectParameters>
                <asp:Parameter DefaultValue="2" Name="NoteTypeId" Type="Int32" />
                <asp:ControlParameter ControlID="gvVenues" DefaultValue="" Name="EntityId" PropertyName="SelectedValue"
                    Type="Int32" />
                <asp:Parameter DefaultValue="DateCreated" Name="sortExpression" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </form>
</body>
</html>
